from pylab import *
from numpy import zeros,double,int

xAxis = open('axis', 'r')

f = xAxis.readlines()

x = zeros(len(f))
for i in xrange(len(f)):
    x[i] = double(f[i])
    
print x

media = open('dMedia', 'r')
desvio = open('dDesvio', 'r')

f1 = media.readlines()
f2 = desvio.readlines()

y1 = zeros(len(f1))
y2 = zeros(len(f2))

for i in xrange(len(f1)):
    y1[i] = double(f1[i])
    y2[i] = double(f2[i])
    
print y1
print y2

plot(x, y1, x, (y1-y2), 'r--', x, (y1+y2), 'g--')
legend( ('Media', 'Media menos desvio', 'Media mas desvio'))


#[xmin, xmax, ymin, ymax]

axis([0.02, 0.2, min(y1-y2)-0.1, max(y1+y2)+0.2])

xlabel('Factor de suavidad')
ylabel('Coeficiente de Dice')

title('Media y desvio de Dice en funcion del factor de suavidad')

show()
